﻿<navigation:Page
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
    xmlns:models="clr-namespace:InsuranceAdjuster.Models"
    xmlns:design="clr-namespace:InsuranceAdjuster.DesignModels"
    xmlns:helpers="clr-namespace:InsuranceAdjuster.Helpers"
    xmlns:swd="clr-namespace:System.Windows.Data;assembly=System.Windows"
    xmlns:compMod="clr-namespace:System.ComponentModel;assembly=System.Windows"
    xmlns:InsuranceAdjuster_Helpers="clr-namespace:InsuranceAdjuster.Helpers"
    xmlns:System="clr-namespace:System;assembly=mscorlib" 
    xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk" 
    x:Class="InsuranceAdjuster.Home"
    mc:Ignorable="d" d:DesignWidth="997" d:DesignHeight="620"  
    Width="1000" Height="660"
    FontSize="14.667"
    DataContext="{Binding Path=Appointments, Source={StaticResource Locator}}"  
    >

    <navigation:Page.Resources>
        <InsuranceAdjuster_Helpers:ExtractTimeConverter x:Key="ExtractTimeConverter"/>
        <InsuranceAdjuster_Helpers:ExtractDateConverter x:Key="ExtractDateConverter"/>
        <ControlTemplate x:Key="ValidationToolTipTemplate" >
            <Grid x:Name="Root" Margin="5,0" Opacity="0" RenderTransformOrigin="0,0">
                <Grid.RenderTransform>
                    <TranslateTransform x:Name="xform" X="-25"/>
                </Grid.RenderTransform>
                <VisualStateManager.VisualStateGroups>
                    <VisualStateGroup x:Name="OpenStates">
                        <VisualStateGroup.Transitions>
                            <VisualTransition GeneratedDuration="0"/>
                            <VisualTransition GeneratedDuration="0:0:0.2" To="Open">
                                <Storyboard>
                                    <DoubleAnimation Duration="0:0:0.2" To="0" Storyboard.TargetProperty="X" Storyboard.TargetName="xform">
                                        <DoubleAnimation.EasingFunction>
                                            <BackEase Amplitude=".3" EasingMode="EaseOut"/>
                                        </DoubleAnimation.EasingFunction>
                                    </DoubleAnimation>
                                    <DoubleAnimation Duration="0:0:0.2" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Root"/>
                                </Storyboard>
                            </VisualTransition>
                        </VisualStateGroup.Transitions>
                        <VisualState x:Name="Closed">
                            <Storyboard>
                                <DoubleAnimation Duration="0" To="0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Root"/>
                            </Storyboard>
                        </VisualState>
                        <VisualState x:Name="Open">
                            <Storyboard>
                                <DoubleAnimation Duration="0" To="0" Storyboard.TargetProperty="X" Storyboard.TargetName="xform"/>
                                <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Root"/>
                            </Storyboard>
                        </VisualState>
                    </VisualStateGroup>
                </VisualStateManager.VisualStateGroups>
                <Border Background="#052A2E31" CornerRadius="5" Margin="4,4,-4,-4"/>
                <Border Background="#152A2E31" CornerRadius="4" Margin="3,3,-3,-3"/>
                <Border Background="#252A2E31" CornerRadius="3" Margin="2,2,-2,-2"/>
                <Border Background="#352A2E31" CornerRadius="2" Margin="1,1,-1,-1"/>
                <Border Background="#FFDC000C" CornerRadius="2"/>
                <Border CornerRadius="2">
                    <TextBlock Foreground="White" MaxWidth="250" Margin="8,4,8,4" TextWrapping="Wrap" Text="{Binding (Validation.Errors)[0].ErrorContent}" UseLayoutRounding="false"/>
                </Border>
            </Grid>
        </ControlTemplate>
        <Style x:Key="ScrollViewerStyle1" TargetType="ScrollViewer">
            <Setter Property="HorizontalContentAlignment" Value="Left"/>
            <Setter Property="VerticalContentAlignment" Value="Top"/>
            <Setter Property="VerticalScrollBarVisibility" Value="Visible"/>
            <Setter Property="Padding" Value="4"/>
            <Setter Property="BorderThickness" Value="1"/>
            <Setter Property="BorderBrush">
                <Setter.Value>
                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                        <GradientStop Color="#FFA3AEB9" Offset="0"/>
                        <GradientStop Color="#FF8399A9" Offset="0.375"/>
                        <GradientStop Color="#FF718597" Offset="0.375"/>
                        <GradientStop Color="#FF617584" Offset="1"/>
                    </LinearGradientBrush>
                </Setter.Value>
            </Setter>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="ScrollViewer">
                        <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="2">
                            <Grid Background="{TemplateBinding Background}">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="*"/>
                                    <RowDefinition Height="Auto"/>
                                </Grid.RowDefinitions>
                                <ScrollContentPresenter x:Name="ScrollContentPresenter" Cursor="{TemplateBinding Cursor}" ContentTemplate="{TemplateBinding ContentTemplate}" Margin="{TemplateBinding Padding}"/>
                                <Rectangle Grid.Column="1" Fill="#FFE9EEF4" Grid.Row="1"/>
                                <ScrollBar x:Name="VerticalScrollBar" Grid.Column="1" IsTabStop="False" Maximum="{TemplateBinding ScrollableHeight}" Margin="0,-1,-1,-1" Minimum="0" Orientation="Vertical" Grid.Row="0" Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}" Value="{TemplateBinding VerticalOffset}" ViewportSize="{TemplateBinding ViewportHeight}" Width="18"/>
                                <ScrollBar x:Name="HorizontalScrollBar" Grid.Column="0" Height="18" IsTabStop="False" Maximum="{TemplateBinding ScrollableWidth}" Margin="-1,0,-1,-1" Minimum="0" Orientation="Horizontal" Grid.Row="1" Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}" Value="{TemplateBinding HorizontalOffset}" ViewportSize="{TemplateBinding ViewportWidth}"/>
                            </Grid>
                        </Border>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="ListBoxStyle1" TargetType="ListBox">
            <Setter Property="Padding" Value="1"/>
            <Setter Property="Background" Value="#FFFFFFFF"/>
            <Setter Property="Foreground" Value="#FF000000"/>
            <Setter Property="HorizontalContentAlignment" Value="Left"/>
            <Setter Property="VerticalContentAlignment" Value="Top"/>
            <Setter Property="IsTabStop" Value="False"/>
            <Setter Property="BorderThickness" Value="1"/>
            <Setter Property="TabNavigation" Value="Once"/>
            <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
            <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
            <Setter Property="BorderBrush">
                <Setter.Value>
                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                        <GradientStop Color="#FFA3AEB9" Offset="0"/>
                        <GradientStop Color="#FF8399A9" Offset="0.375"/>
                        <GradientStop Color="#FF718597" Offset="0.375"/>
                        <GradientStop Color="#FF617584" Offset="1"/>
                    </LinearGradientBrush>
                </Setter.Value>
            </Setter>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="ListBox">
                        <Grid>
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="ValidationStates">
                                    <VisualState x:Name="Valid"/>
                                    <VisualState x:Name="InvalidUnfocused">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="ValidationErrorElement">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Visibility>Visible</Visibility>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="InvalidFocused">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="ValidationErrorElement">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Visibility>Visible</Visibility>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="IsOpen" Storyboard.TargetName="validationTooltip">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <System:Boolean>True</System:Boolean>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="2">
                                <ScrollViewer x:Name="ScrollViewer" BorderBrush="Transparent" BorderThickness="0" Background="{TemplateBinding Background}" TabNavigation="{TemplateBinding TabNavigation}" ScrollViewer.HorizontalScrollBarVisibility="Hidden" ScrollViewer.VerticalScrollBarVisibility="Hidden" Style="{StaticResource ScrollViewerStyle1}" Padding="0">
                                    <ItemsPresenter/>
                                </ScrollViewer>
                            </Border>
                            <Border x:Name="ValidationErrorElement" BorderBrush="#FFDB000C" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="2" Visibility="Collapsed">
                                <ToolTipService.ToolTip>
                                    <ToolTip x:Name="validationTooltip" DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}}" Placement="Right" PlacementTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}" Template="{StaticResource ValidationToolTipTemplate}">
                                        <ToolTip.Triggers>
                                            <EventTrigger RoutedEvent="Canvas.Loaded">
                                                <BeginStoryboard>
                                                    <Storyboard>
                                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="IsHitTestVisible" Storyboard.TargetName="validationTooltip">
                                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                                <DiscreteObjectKeyFrame.Value>
                                                                    <System:Boolean>true</System:Boolean>
                                                                </DiscreteObjectKeyFrame.Value>
                                                            </DiscreteObjectKeyFrame>
                                                        </ObjectAnimationUsingKeyFrames>
                                                    </Storyboard>
                                                </BeginStoryboard>
                                            </EventTrigger>
                                        </ToolTip.Triggers>
                                    </ToolTip>
                                </ToolTipService.ToolTip>
                                <Grid Background="Transparent" HorizontalAlignment="Right" Height="10" Margin="0,-4,-4,0" VerticalAlignment="Top" Width="10">
                                    <Path Data="M 1,0 L6,0 A 2,2 90 0 1 8,2 L8,7 z" Fill="#FFDC000C" Margin="-1,3,0,0"/>
                                    <Path Data="M 0,0 L2,0 L 8,6 L8,8" Fill="#ffffff" Margin="-1,3,0,0"/>
                                </Grid>
                            </Border>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="ListBoxItemStyle1" TargetType="ListBoxItem">
            <Setter Property="Padding" Value="3"/>
            <Setter Property="HorizontalContentAlignment" Value="Left"/>
            <Setter Property="VerticalContentAlignment" Value="Top"/>
            <Setter Property="Background" Value="Transparent"/>
            <Setter Property="BorderThickness" Value="1"/>
            <Setter Property="TabNavigation" Value="Local"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="ListBoxItem">
                        <Grid Background="{TemplateBinding Background}">
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualState x:Name="Normal"/>
                                    <VisualState x:Name="MouseOver">
                                        <Storyboard>
                                            <DoubleAnimation Duration="0" To="0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="fillColor"/>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Disabled">
                                        <Storyboard>
                                            <DoubleAnimation Duration="0" To=".55" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="contentPresenter"/>
                                        </Storyboard>
                                    </VisualState>
                                </VisualStateGroup>
                                <VisualStateGroup x:Name="SelectionStates">
                                    <VisualState x:Name="Unselected">
                                        <Storyboard>
                                            <DoubleAnimation Duration="0" To="0.48" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="border" d:IsOptimized="True"/>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Selected">
                                        <Storyboard>
                                            <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="fillColor2"/>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="SelectedUnfocused">
                                        <Storyboard>
                                            <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="fillColor2"/>
                                        </Storyboard>
                                    </VisualState>
                                </VisualStateGroup>
                                <VisualStateGroup x:Name="FocusStates">
                                    <VisualState x:Name="Focused">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Visibility" Storyboard.TargetName="FocusVisualElement">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Visibility>Collapsed</Visibility>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Unfocused"/>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <Rectangle x:Name="fillColor" Fill="#FFBADDE9" IsHitTestVisible="False" Opacity="0" RadiusY="1" RadiusX="1"/>
                            <Rectangle x:Name="fillColor2" Fill="#FFFFEEB0" IsHitTestVisible="False" Opacity="0" RadiusY="1" RadiusX="1"/>
                            <ContentPresenter x:Name="contentPresenter" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}"/>
                            <Rectangle x:Name="FocusVisualElement" RadiusY="1" RadiusX="1" Stroke="#FF6DBDD1" StrokeThickness="1" Visibility="Collapsed"/>
                            <Border x:Name="border" BorderBrush="Black" BorderThickness="0" HorizontalAlignment="Right" Width="52" Margin="0,0,-9,0" Style="{StaticResource YellowBorderStyle}">
                                <Path Data="M19.549999,1.5 L19.549999,19.550001 L1.5,19.550001" Margin="8.975,33.475,19.975,41.475" RenderTransformOrigin="0.5,0.5" Stretch="Fill" Stroke="White" StrokeThickness="3" UseLayoutRounding="False" d:LayoutRounding="Auto">
                                    <Path.RenderTransform>
                                        <CompositeTransform Rotation="-45" TranslateX="1.0052642807067969E-07" TranslateY="-2.793247375620922E-07"/>
                                    </Path.RenderTransform>
                                </Path>
                            </Border>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="CheckBoxStyle1" TargetType="CheckBox">
            <Setter Property="Background" Value="#FF448DCA"/>
            <Setter Property="Foreground" Value="#FF000000"/>
            <Setter Property="HorizontalContentAlignment" Value="Left"/>
            <Setter Property="VerticalContentAlignment" Value="Top"/>
            <Setter Property="Padding" Value="4,1,0,0"/>
            <Setter Property="BorderThickness" Value="1"/>
            <Setter Property="BorderBrush">
                <Setter.Value>
                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                        <GradientStop Color="#FFA3AEB9" Offset="0"/>
                        <GradientStop Color="#FF8399A9" Offset="0.375"/>
                        <GradientStop Color="#FF718597" Offset="0.375"/>
                        <GradientStop Color="#FF617584" Offset="1"/>
                    </LinearGradientBrush>
                </Setter.Value>
            </Setter>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="CheckBox">
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="16"/>
                                <ColumnDefinition Width="*"/>
                            </Grid.ColumnDefinitions>
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualState x:Name="Normal"/>
                                    <VisualState x:Name="MouseOver">
                                        <Storyboard>
                                            <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BackgroundOverlay"/>
                                            <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BoxMiddleBackground"/>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Pressed">
                                        <Storyboard>
                                            <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BackgroundOverlay"/>
                                            <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BoxMiddleBackground"/>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Disabled">
                                        <Storyboard>
                                            <DoubleAnimation Duration="0" To=".55" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="contentPresenter"/>
                                            <DoubleAnimation Duration="0" To="0.55" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="DisabledVisualElement"/>
                                        </Storyboard>
                                    </VisualState>
                                </VisualStateGroup>
                                <VisualStateGroup x:Name="CheckStates">
                                    <VisualState x:Name="Checked">
                                        <Storyboard>
                                            <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="CheckIcon"/>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Unchecked"/>
                                    <VisualState x:Name="Indeterminate">
                                        <Storyboard>
                                            <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="IndeterminateIcon"/>
                                        </Storyboard>
                                    </VisualState>
                                </VisualStateGroup>
                                <VisualStateGroup x:Name="FocusStates">
                                    <VisualState x:Name="Focused">
                                        <Storyboard>
                                            <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="ContentFocusVisualElement"/>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Unfocused"/>
                                </VisualStateGroup>
                                <VisualStateGroup x:Name="ValidationStates">
                                    <VisualState x:Name="Valid"/>
                                    <VisualState x:Name="InvalidUnfocused">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="ValidationErrorElement">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Visibility>Visible</Visibility>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="InvalidFocused">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="ValidationErrorElement">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Visibility>Visible</Visibility>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="IsOpen" Storyboard.TargetName="validationTooltip">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <System:Boolean>True</System:Boolean>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <Grid HorizontalAlignment="Left" VerticalAlignment="Top">
                                <Rectangle x:Name="Background" Height="14" Margin="1" RadiusY="1" RadiusX="1" Stroke="{StaticResource MainTextColor}" StrokeThickness="{TemplateBinding BorderThickness}" Width="14"/>
                                <Rectangle x:Name="BackgroundOverlay" Height="14" Margin="1" Opacity="0" RadiusY="1" RadiusX="1" StrokeThickness="1" Width="14"/>
                                <Rectangle x:Name="BoxMiddleBackground" Height="10" RadiusY="1" RadiusX="1" StrokeThickness="1" Width="10"/>
                                <Rectangle x:Name="BoxMiddle" Height="10" RadiusY="1" RadiusX="1" StrokeThickness="1" Width="10"/>
                                <Rectangle x:Name="BoxMiddleLine" Height="10" Opacity=".2" RadiusY="1" RadiusX="1" StrokeThickness="1" Width="10"/>
                                <Path x:Name="CheckIcon" Data="M102.03442,598.79645 L105.22962,597.78918 L106.78825,600.42358 C106.78825,600.42358 108.51028,595.74304 110.21724,593.60419 C112.00967,591.35822 114.89314,591.42316 114.89314,591.42316 C114.89314,591.42316 112.67844,593.42645 111.93174,594.44464 C110.7449,596.06293 107.15683,604.13837 107.15683,604.13837 z" Fill="{StaticResource MainTextColor}" FlowDirection="LeftToRight" Height="10" Margin="1,1,0,1.5" Opacity="0" Stretch="Fill" Width="10.5"/>
                                <Rectangle x:Name="IndeterminateIcon" Fill="#FF333333" Height="2" Opacity="0" Width="6"/>
                                <Rectangle x:Name="DisabledVisualElement" Fill="#FFFFFFFF" Height="14" Opacity="0" RadiusY="1" RadiusX="1" Width="14"/>
                                <Rectangle x:Name="ContentFocusVisualElement" Height="16" IsHitTestVisible="false" Opacity="0" RadiusY="2" RadiusX="2" StrokeThickness="1" Width="16"/>
                                <Border x:Name="ValidationErrorElement" BorderBrush="#FFDB000C" BorderThickness="1" CornerRadius="1" Margin="1" ToolTipService.PlacementTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}" Visibility="Collapsed">
                                    <ToolTipService.ToolTip>
                                        <ToolTip x:Name="validationTooltip" DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}}" Placement="Right" PlacementTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}" Template="{StaticResource ValidationToolTipTemplate}">
                                            <ToolTip.Triggers>
                                                <EventTrigger RoutedEvent="Canvas.Loaded">
                                                    <BeginStoryboard>
                                                        <Storyboard>
                                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="IsHitTestVisible" Storyboard.TargetName="validationTooltip">
                                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                                    <DiscreteObjectKeyFrame.Value>
                                                                        <System:Boolean>true</System:Boolean>
                                                                    </DiscreteObjectKeyFrame.Value>
                                                                </DiscreteObjectKeyFrame>
                                                            </ObjectAnimationUsingKeyFrames>
                                                        </Storyboard>
                                                    </BeginStoryboard>
                                                </EventTrigger>
                                            </ToolTip.Triggers>
                                        </ToolTip>
                                    </ToolTipService.ToolTip>
                                    <Grid Background="Transparent" HorizontalAlignment="Right" Height="10" Margin="0,-4,-4,0" VerticalAlignment="Top" Width="10">
                                        <Path Data="M 1,0 L5,0 A 2,2 90 0 1 7,2 L7,6 z" Fill="#FFDC000C" Margin="0,3,0,0"/>
                                        <Path Data="M 0,0 L2,0 L 7,5 L7,7" Fill="#ffffff" Margin="0,3,0,0"/>
                                    </Grid>
                                </Border>
                            </Grid>
                            <ContentPresenter x:Name="contentPresenter" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" Grid.Column="1" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <Storyboard x:Name="RotateDetails">
            <DoubleAnimation Duration="0:0:0.5" To="180" Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.RotationY)" Storyboard.TargetName="spinner" d:IsOptimized="True"/>
            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="detailsList">
                <DiscreteObjectKeyFrame KeyTime="0:0:0.25">
                    <DiscreteObjectKeyFrame.Value>
                        <Visibility>Collapsed</Visibility>
                    </DiscreteObjectKeyFrame.Value>
                </DiscreteObjectKeyFrame>
            </ObjectAnimationUsingKeyFrames>
            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="columnChooser">
                <DiscreteObjectKeyFrame KeyTime="0:0:0.25">
                    <DiscreteObjectKeyFrame.Value>
                        <Visibility>Visible</Visibility>
                    </DiscreteObjectKeyFrame.Value>
                </DiscreteObjectKeyFrame>
            </ObjectAnimationUsingKeyFrames>
            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="textBlock1">
                <DiscreteObjectKeyFrame KeyTime="0:0:0.25">
                    <DiscreteObjectKeyFrame.Value>
                        <Visibility>Visible</Visibility>
                    </DiscreteObjectKeyFrame.Value>
                </DiscreteObjectKeyFrame>
            </ObjectAnimationUsingKeyFrames>
            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="textBlock">
                <DiscreteObjectKeyFrame KeyTime="0:0:0.25">
                    <DiscreteObjectKeyFrame.Value>
                        <Visibility>Collapsed</Visibility>
                    </DiscreteObjectKeyFrame.Value>
                </DiscreteObjectKeyFrame>
            </ObjectAnimationUsingKeyFrames>
        </Storyboard>
        <Storyboard x:Name="RotateDetailsBack">
            <DoubleAnimation Duration="0:0:0.5" To="0" Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.RotationY)" Storyboard.TargetName="spinner" d:IsOptimized="True"/>
            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="detailsList">
                <DiscreteObjectKeyFrame KeyTime="0:0:0.25">
                    <DiscreteObjectKeyFrame.Value>
                        <Visibility>Visible</Visibility>
                    </DiscreteObjectKeyFrame.Value>
                </DiscreteObjectKeyFrame>
            </ObjectAnimationUsingKeyFrames>
            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="columnChooser">
                <DiscreteObjectKeyFrame KeyTime="0:0:0.25">
                    <DiscreteObjectKeyFrame.Value>
                        <Visibility>Collapsed</Visibility>
                    </DiscreteObjectKeyFrame.Value>
                </DiscreteObjectKeyFrame>
            </ObjectAnimationUsingKeyFrames>
            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="textBlock">
                <DiscreteObjectKeyFrame KeyTime="0:0:0.25">
                    <DiscreteObjectKeyFrame.Value>
                        <Visibility>Visible</Visibility>
                    </DiscreteObjectKeyFrame.Value>
                </DiscreteObjectKeyFrame>
            </ObjectAnimationUsingKeyFrames>
            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="textBlock1">
                <DiscreteObjectKeyFrame KeyTime="0:0:0.25">
                    <DiscreteObjectKeyFrame.Value>
                        <Visibility>Collapsed</Visibility>
                    </DiscreteObjectKeyFrame.Value>
                </DiscreteObjectKeyFrame>
            </ObjectAnimationUsingKeyFrames>
        </Storyboard>

    </navigation:Page.Resources>

    <Grid x:Name="LayoutRoot">
        <Grid.RowDefinitions>
            <RowDefinition Height="{StaticResource TitleBarHeight}"/>
            <RowDefinition Height="545.75"/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="0.639*"/>
            <ColumnDefinition Width="0.138*"/>
            <ColumnDefinition Width="0.223*"/>
        </Grid.ColumnDefinitions>
        <Border Grid.Column="1" Margin="0,8,8,26.75" Grid.Row="1" Background="#FFFEFEFE">




            <!-- Custom Markup Extension-->
            <ListBox x:Name="appointmentsListbox" Style="{StaticResource ListBoxStyle1}" ItemContainerStyle="{StaticResource ListBoxItemStyle1}" Grid.Row="1" Background="#FFFEFEFE" BorderThickness="0" Margin="0,0,0,-25" 
                     SelectedItem="{Binding SelectedAppointment, Mode=TwoWay}" 
                     SelectionChanged="OnAppointmentsListboxSelectionChanged"
                >
                <!-- Direct Databinding-->
                <!-- 
                     SelectionChanged="{helpers:MethodInvoke Method=OnAppointmentChanged}"   
                    ItemsSource="{Binding Appointments}"
                -->


                <!-- CollectionViewSource -->
                <ListBox.ItemsSource >
                    <Binding>                        
                        <Binding.Source>
                            <swd:CollectionViewSource Source="{Binding Path=Appointments.Appointments, Source={StaticResource Locator}}" >
                                <swd:CollectionViewSource.SortDescriptions>
                                    <compMod:SortDescription PropertyName="AppointmentDateTime" Direction="Ascending"/>
                                </swd:CollectionViewSource.SortDescriptions>
                            </swd:CollectionViewSource>
                        </Binding.Source>
                    </Binding>
                </ListBox.ItemsSource>
                <!--
                -->










                <!-- ItemsSource="{Binding Appointments}"  -->
                <!-- {Binding Appointments}  -->
                <!-- {Binding AppointmentView, Source={StaticResource SortedAppointmentView}} -->
                <!--<ListBox x:Name="appointmentsListbox" Style="{StaticResource ListBoxStyle1}" ItemContainerStyle="{StaticResource ListBoxItemStyle1}" Grid.Row="1" Background="#FFFEFEFE" BorderThickness="0" Margin="0,0,0,-25" SelectedItem="{Binding SelectedAppointment, Mode=TwoWay}" 
                	ItemsSource="{Binding AppointmentView, Source={StaticResource SortedAppointmentView}}" 
                    SelectionChanged="{helpers:MethodInvoke Method=OnAppointmentChanged}" >-->







                <!-- Custom Markup Extensions
                         SelectionChanged="{helpers:MethodInvoke 
                                                            Method=OnAppointmentChanged}"
                    SelectionChanged="OnAppointmentsListboxSelectionChanged"

                    Use Binding Selected Item, rather than MethodBinding
                 	SelectedItem="{Binding SelectedAppointment, Mode=TwoWay}" 
                    -->

                <ListBox.ItemTemplate>
                    <DataTemplate >
                        <Grid Background="Transparent" Width="572">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="Auto" MinWidth="100.5"/>
                                <ColumnDefinition Width="0.498*"/>
                                <ColumnDefinition Width="0.502*"/>
                                <ColumnDefinition Width="52"/>
                            </Grid.ColumnDefinitions>
                            <TextBlock Text="{Binding ApptAddressLine1}" Margin="0,8,0,0" VerticalAlignment="Top" d:LayoutOverrides="Width" Grid.Column="3" Style="{StaticResource MainTextBlockStyle}"/>
                            <StackPanel Orientation="Horizontal" Margin="0,33,0,0" d:LayoutOverrides="Width" Grid.Column="3" VerticalAlignment="Top">
                                <TextBlock TextWrapping="Wrap" Text="{Binding ApptCity}" d:LayoutOverrides="Width" Margin="0,0,8,0" Style="{StaticResource MainTextBlockStyle}"/>
                                <TextBlock TextWrapping="Wrap" Text="{Binding AppStateCode}" Margin="0,0,8,0" Style="{StaticResource MainTextBlockStyle}"/>
                                <TextBlock TextWrapping="Wrap" Text="{Binding ApptZip}" Margin="0,0,8,0" Style="{StaticResource MainTextBlockStyle}"/>
                            </StackPanel>
                            <StackPanel Grid.Column="1" Margin="8,0" Orientation="Vertical" d:LayoutOverrides="Height" VerticalAlignment="Center" HorizontalAlignment="Left">
                                <TextBlock TextWrapping="Wrap" Text="{Binding AppointmentDateTime, Converter={StaticResource ExtractTimeConverter}}" Margin="0" VerticalAlignment="Top" d:LayoutOverrides="Width" Style="{StaticResource CalendarStyle}" FontFamily="Arial" FontWeight="Bold"/>
                                <TextBlock TextWrapping="Wrap" Text="{Binding AppointmentDateTime, Converter={StaticResource ExtractDateConverter}}" Margin="0" d:LayoutOverrides="VerticalAlignment, Width" TextAlignment="Center" Style="{StaticResource CalendarStyle}" FontSize="16" FontWeight="Bold" FontFamily="Arial"/>
                            </StackPanel>
                            <TextBlock Margin="0.5,9,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Grid.Column="2" HorizontalAlignment="Left" Text="{Binding Dealership}" FontSize="{StaticResource BiggerTextSize}" Style="{StaticResource MainTextBlockStyle}" FontWeight="Bold"/>
                            <TextBlock Margin="0.5,31,0,0" TextWrapping="Wrap" Grid.Column="2" HorizontalAlignment="Left" Text="{Binding Phone}" VerticalAlignment="Top" Style="{StaticResource MainTextBlockStyle}" FontSize="16"/>
                            <Rectangle Fill="#FFE9E9E9" Margin="8,8,8,0" Height="80" VerticalAlignment="Top" HorizontalAlignment="Left" Width="80" Visibility="Collapsed"/>
                            <Rectangle Grid.Column="3" Fill="{StaticResource LightTextColor}" HorizontalAlignment="Left" Margin="0,59,0,0" Width="16" Height="16" VerticalAlignment="Top"/>
                            <TextBlock Margin="20,55,0,0" TextWrapping="Wrap" Text="Map" d:LayoutOverrides="Height" Grid.Column="3" HorizontalAlignment="Left" VerticalAlignment="Top" Style="{StaticResource MainTextBlockStyle}"/>
                        </Grid>
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>
        </Border>
        <HyperlinkButton Name="OpenClaimHyperlink" Content="Open" HorizontalAlignment="Right" VerticalAlignment="Bottom" Width="75" Grid.Column="3" Margin="0,0,56,34.75" TargetName="ContentFrame" Foreground="Black" FontSize="24" Grid.Row="1" NavigateUri="{Binding Path=SelectedClaim.EntityGuid, StringFormat=/IncidentView?entityGuid\=\{0\}}" />
        <TextBlock x:Name="Title" Grid.Column="1" HorizontalAlignment="Left" Margin="0,31,0,0" TextWrapping="Wrap" Text="Dashboard" Style="{StaticResource TitleStyle}" d:LayoutOverrides="Height" FontFamily="Arial"/>
        <TextBlock HorizontalAlignment="Left" TextWrapping="Wrap" Text="Silverlight" Margin="44,10,0,24.25" FontFamily="Segoe" d:LayoutOverrides="Height, VerticalMargin" Visibility="Collapsed"/>
        <TextBlock HorizontalAlignment="Left" TextWrapping="Wrap" Text="Insurance" Margin="44,25,0,0" d:LayoutOverrides="Height" FontFamily="Segoe" FontSize="21.333" Visibility="Collapsed"/>
        <Grid x:Name="spinner" Grid.ColumnSpan="2" Grid.Column="2" Margin="-8,8,56,95.75" Grid.Row="1">
            <Grid.Projection>
                <PlaneProjection/>
            </Grid.Projection>
            <Rectangle Style="{StaticResource YellowRectangleStyle}"/>
            <Grid x:Name="flickr" Margin="19,0,19,-70">
                <Grid.RenderTransform>
                    <CompositeTransform/>
                </Grid.RenderTransform>



                <Grid Margin="31,36,80,0" VerticalAlignment="Top" Visibility="Collapsed">
                    <sdk:Label HorizontalAlignment="Left" VerticalAlignment="Top" Style="{StaticResource IncidentDetailsLabel}"/>
                    <sdk:Label HorizontalAlignment="Left" Margin="0,20,0,0" VerticalAlignment="Top" Content="Label is longer"/>
                </Grid>
                <Grid Margin="31,93,80,0" VerticalAlignment="Top" Visibility="Collapsed">
                    <sdk:Label HorizontalAlignment="Left" VerticalAlignment="Top" Foreground="White" FontSize="12"/>
                    <sdk:Label HorizontalAlignment="Left" Margin="0,20,0,0" VerticalAlignment="Top" Content="Label is longer"/>
                </Grid>


                <ListBox Height="320" HorizontalAlignment="Left"  x:Name="columnChooser" VerticalAlignment="Top" Width="260" ItemsSource="{Binding ClaimDisplayFields}" ScrollViewer.VerticalScrollBarVisibility="Visible" Margin="0,52,0,0" Background="{x:Null}" BorderBrush="{x:Null}" Visibility="Collapsed" RenderTransformOrigin="0.5,0.5">
                    <ListBox.ItemTemplate>
                        <DataTemplate>
                            <StackPanel Orientation="Horizontal">
                                <CheckBox IsChecked="{Binding Selected, Mode=TwoWay}" Style="{StaticResource CheckBoxStyle1}" Margin="0,5,0,0"/>
                                <TextBlock Text="{Binding Description}" Style="{StaticResource MainTextBlockStyle}"/>
                            </StackPanel>
                        </DataTemplate>

                    </ListBox.ItemTemplate>
                    <ListBox.RenderTransform>
                        <CompositeTransform ScaleX="-1"/>
                    </ListBox.RenderTransform>
                </ListBox>

                <TextBlock x:Name="textBlock1" TextWrapping="Wrap" Text="Select Fields" Foreground="White" FontFamily="Segoe" FontSize="26.667" VerticalAlignment="Top" Margin="0,0,-19,0" RenderTransformOrigin="0.5,0.5" Visibility="Collapsed">
                                   			<TextBlock.RenderTransform>
        				<CompositeTransform ScaleX="-1"/>
        			</TextBlock.RenderTransform>
                </TextBlock>

                <ItemsControl HorizontalAlignment="Left" x:Name="detailsList" VerticalAlignment="Top" ItemsSource="{Binding DetailControls}" Margin="0,40,0,0" Width="260" Height="320" Visibility="Visible">
                    <!--<ItemsControl.RenderTransform>
        				<CompositeTransform ScaleX="-1"/>
        			</ItemsControl.RenderTransform>-->
                </ItemsControl>
                <TextBlock x:Name="textBlock" TextWrapping="Wrap" Text="Incident Details" Foreground="White" FontFamily="Segoe" FontSize="26.667" VerticalAlignment="Top"  Visibility="Visible">
                </TextBlock>
            </Grid>
            <Border Height="35" Margin="0,393,0,0" BorderBrush="{StaticResource MainTextColor}" BorderThickness="1" CornerRadius="1" 
        		MouseLeftButtonDown="columnChooserToggle" VerticalAlignment="Top" Width="34" HorizontalAlignment="Center" Background="{StaticResource YellowBrush}">
                <Image Source="/InsuranceAdjuster;component/Assets/Settings.PNG" Stretch="Fill" RenderTransformOrigin="1.531,0.553"/>
            </Border>
        </Grid>
    </Grid>

</navigation:Page>